const query = require('./index')

class CommentModel {
    constructor() {}

    static notice_select_top8 () {
        const _sql = `SELECT id,notice_title FROM notice order by id DESC limit 8`;
        return query(_sql);
      };
      
    static notice_all_select () {
        const _sql = `SELECT * FROM notice order by id DESC`;
        return query(_sql);
      };

    //   notice_select_by_id
    static notice_select_by_id(values) {
        const _sql = `SELECT * from notice WHERE id = ?`;
        return query(_sql, values);
      }
    static notice_insert_inst(values){
      const _sql = `INSERT INTO notice SET ?`
      return query(_sql, values)
    }

    static notice_delete_by_id (values) {
      const _sql = 'DELETE FROM notice WHERE id = ' + values
      return query(_sql, values)
    }
    // 批量删除
    static pl_delete(values){
      const _sql = 'delete from notice where id in '
      return query(_sql, values)
    }
  }
  
  module.exports = CommentModel